package com.sqx.modules.task.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sqx.modules.task.entity.TbUserTask;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
* @author Admin
* @description 针对表【tb_user_task(用户每日任务完成情况表)】的数据库操作Mapper
* @createDate 2024-07-22 10:56:35
* @Entity generator.domain.TbUserTask
*/
@Mapper
public interface TbUserTaskDao extends BaseMapper<TbUserTask> {

    TbUserTask selectByUserId(@Param("taskId") Long taskId,
                              @Param("userId") Long userId);

    List<TbUserTask> selectByCreateTime(@Param("userId") Long userId,
                                  @Param("startTime") LocalDate startTime,
                                  @Param("taskId") Long taskId);

    TbUserTask selectByTaskId(@Param("userId") Long userId,
                              @Param("taskId") Long taskId);

    List<TbUserTask> findTasksByDateAndType(@Param("now") LocalDate now,
                                            @Param("taskId")Long taskId);

    void updateByBatch(@Param("userTaskList") List<TbUserTask> userTaskList);
}




